import re
pattern = 'aa|bb|cc'
# print(re.match(pattern,'aa'))
# print(re.match(pattern,'bb'))
# print(re.match(pattern,'cc'))
# print(re.search(pattern,'where is bb'))

#匹配0-100之间所有的数字
s = '0'
s = '9'
s = '10'
# s = '99'
# s = '100'
# s = '101'
# s = '1000'
pattern = r'[1-9]?\d$|100$'
# print(re.match(pattern,s))

# '[xyz]' 和 'x|y|z'
pattern = '[xyz]'
pattern1 = 'x|y|z'
# print(re.match(pattern,'y'))
# print(re.match(pattern1,'y'))

#区别
#匹配第一个字母是a或b  第二字母可以是c或d  结果ac ad bc bd
# print(re.match('[ab][cd]','aceg'))

# print(re.match('ab[cd]','abcd'))

print(re.match('ab|cd','ab'))
